package com.xxljob.fy.core.properties;

import lombok.Data;
import org.springframework.boot.context.properties.ConfigurationProperties;

@ConfigurationProperties(prefix = "xxl.job")
@Data
public class XxlJobProperties {

    private String accessToken;
    /**
     * xxl job admin properties.
     */
    private AdminProperties admin = new AdminProperties();
    /**
     * xxl job executor properties.
     */
    private ExecutorProperties executor = new ExecutorProperties();

    @Data
    static public class AdminProperties {
        private String adminAddresses = "http://myxxljob.com/xxl-job-admin";
    }

    @Data
    static public class ExecutorProperties {
        private String address;
        private String appname = "xxl-job-executor";
        private String ip;
        private Integer port = -1;
        private String logPath = "/data/applogs/xxl-job/jobhandler";
        private Integer logRetentionDays = 30;
    }
}
